import React from "react";
import "../../../../static/css/pc/bd_tit.css";

export default class BdTit extends React.Component{

	constructor(){
		super();
		this.state = {
			tit:[
				"thumbnail_pic_s":"",
				"title":""
			]
		}
	}

	componentDidMount(){
		var result = fetch(this.props.url,{
			method:"get"
		})
		.then(res => {
			return res.json();
		})
		.then(json => {
			this.setState({
				tit:json
			})
		})
	}

	render(){

		var { tit } = this.state;

		return(
			<div className="tit" style={this.props.titStyle}>
				<h3>{this.props.title}</h3>
				<img src={tit[0].thumbnail_pic_s} alt=""/>
				<p>{tit[0].title}</p>
			</div>
		)
	}
}